<html>
<head>
<script type="text/javascript">
    var srcs = [
        'http://img.ivsky.com/img/tupian/img/201008/06/rose-001.jpg',
        'http://img.ivsky.com/img/tupian/img/201008/06/rose-002.jpg',
        'http://img.ivsky.com/img/tupian/img/201008/06/rose-003.jpg',
        'http://img.ivsky.com/img/tupian/img/201008/06/rose-004.jpg',
        'http://img.ivsky.com/img/tupian/img/201008/06/rose-005.jpg'
    ];
    var MyResources = {
        imageCount: -1,
        imageMap: [],
        _loadHandle: function (ev) {
            MyResources.imageCount -= 1;
            MyResources.imageMap.push(this);
            //var md = document.getElementById('mydiv');
            //var imgTag = document.createElement('img');
            //md.appendChild(this)
        },
        preLoad: function (srcList) {
            this.imageCount = srcList.length;
            for (var i = 0; i < this.imageCount; i++) {
                var img = new Image();
                img.onload = this._loadHandle;
                img.src = srcList[i];
            }
        },
        isReady: function () {
            return this.imageCount;
        }
    };
    MyResources.preLoad(srcs);
    var si = setInterval(function () {
        console.log(MyResources.isReady());
        if (!MyResources.imageCount) clearInterval(si);
    }, 100);
</script>
</head>
<body>
<div id="mydiv"></div>
</body>
</html>
